<?php
/**
 * 键：重写规则，正则表达式
 * 值：重写至的 PATHINFO，若前缀 ! 字符，则结束其后的重写规则
 *
 * 提示：值内容将被传递至 preg_replace() 函数的 $replacement 参数
 *
 */
$rule = array(

"#^/admin(?:/|\-|$)#i" => 'admin~',

"#^(?:/|\-)(\w+)(?:/|\-)(\w+)(?:/|\-)(\d+)#" => '!member-sigin/name-$1/username-$2/page-$3/password-password/email-susisoy@163.com',

"#^(?:/|\-)(\d+)(?:/|\-)(\w+)(?:/|\-)(\w+)#" => '!member-sigin/page-$1/name-$2/username-$3/password-password/email-susisoy@163.com');

foreach ($rule as $key => $value) {
	if (preg_match($key, $info)) {
		$info = preg_replace($key, $value, $info);
		
		if ($info[0] == '!') {
			$info = substr($info, 1);
			
			break;
		}
	}
}